package com.ssh;

import org.junit.Test;

public class Devide_29 {
	
	@Test
	public void test() {
		System.out.println(divide(-2147483648, -1));
	}
	
	public int divide(int dividend, int divisor) {
		int n = 0;
		
		int dividend1 = Math.abs(dividend);
		int divisor1 = Math.abs(divisor);
		int t = divisor1;
		
		for (; divisor1 <= dividend1; n++) {
			divisor1 += t;
		}
		
		if ((dividend > 0 && divisor < 0) || (dividend < 0 && divisor > 0)) {
			n = -n;
		}
        return n;
    }
}
